define(['jquery',
        'underscore',
        'handlebar',
        'backbone',
        '../../collection/category/Ccategory',
        'text!../../../templates/common/itemsRow.html'
        ],
function($,
         Underscore,
         Handlebar,
         Backbone,
         CollectoionCategory,
         TemplateItemsRow){
    
    var VItemsRow = Backbone.View.extend({
        initialize:function (){
            var that = this;
            var collectoionCategory = new CollectoionCategory();
            collectoionCategory.fetch({
                success:function(collectoionCategory){
                    //console.log(collectoionCategory)
                    that.render(collectoionCategory);
                },
                error:function(){
                     console.log('Error in fetching Category Items');
                }
            });
        },
        render:function(collectoionCategory){
             var template = Handlebars.compile(TemplateItemsRow);
             var str_DOM = template(collectoionCategory);
             //console.log(str_DOM);
             $('section#items-row section').append(str_DOM);
        }
    });
    return VItemsRow;
});